<style lang="scss" scoped>
.tv_hot {
}
.avatar {
    position: relative;
}
.tv_hot .avatar {
    display: block;
    overflow: hidden;
}
.tv_hot .avatar img {
}
.avatar:after {
    bottom: 0;
    content: url("~@/icons/play_button.png");
    left: 5px;
    position: absolute;
    top: 45%;
    left: 45%;
    z-index: 10;
}
</style>
<template>
    <div>
        <ui-title class="mt50">热门视频</ui-title>
        <div class="p20 bg-light-white">

            <div @click="link(item.object_id)" v-for="item in listdata" class="ml10 ui-border-bottom mb25 pb15 cursor-pointer">
            <div class="tv_hot fl"><ui-img :url="item.smeta.thumb" style="width:100%;height:250px" class="avatar"></ui-img></div>
               <!--<img class="avater" v-if="item.smeta.thumb || item.smeta.cover" :src="item.smeta.thumb || item.smeta.thumb" style="width:100%">-->
                <p>{{item.post_title}}</p>
            </div>
        </div>
    </div>
</template>
<script>
    export default {
        data(){
            return {
                listdata:[]
            }
        },
        methods:{
            link(id){
                this.$router.push({
                    name:'文章详情',
                    query:{
                        id:id
                    }
                })
            }
        },
        created(){
            this.$http.get('index.php?g=home&m=content&a=get_attr_posts', {
                params:{
                    page_size:2,
                    posttype:1,
                    cid:15
                }
            })
            .then(({data})=>{
                // console.log('视频列表',data)
                if (data.code===1) {
                    this.listdata = data.data
                }
            })
        },
    }
</script>
